package com.hoyue.service;

import com.hoyue.bean.User;
import com.hoyue.dao.UserDao;
import com.hoyue.dao.impl.UserDaoImpl;

import java.sql.SQLException;

/**
 * @author Hoyue_network1
 * @version 1.0
 * Creat by 2018/8/23 17:42
 */
public class UserService {
	UserDao userDao = new UserDaoImpl();

	public User loginUser(String userName, String password) {
		try {
			return userDao.loginUser(userName,password);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}

	public void updateUser(User user) {
		try {
			userDao.update(user);
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

	public void xiuGaiPsw(int id, String psw) {
		try {
			userDao.xiuGaiPsw(id,psw);
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
}
